package main

import (
	"encoding/json"
	"fmt"
	"go-base-learning/src/14_object_oriented/package/model"
)

func main() {
	var student = model.Student{
		Name:  "Jack",
		Score: 100,
	}
	fmt.Println(student)
	stuJson, _ := json.Marshal(student)
	fmt.Println(string(stuJson))

	var cat = model.NewCat("white", 1)
	fmt.Println(*cat)
	fmt.Println(cat.GetName(), cat.GetAge())
	catJson, _ := json.Marshal(*cat)
	// json转化只能转化公有属性
	fmt.Println(string(catJson))
}
